<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="apple-mobile-web-app-title" content="大屏数据展示后台管理系统"/>
    <title>大屏数据展示后台管理系统</title>
    <meta name="description" content="大屏数据展示后台管理系统">
    <meta th:replace="base/meta"/>
    <link rel="stylesheet" href="static/lib/datatables/amazeui.datatables.min.css">
    <link rel="stylesheet" href="static/lib/jsoneditor/jsoneditor.min.css">
</head>

<body>
<header th:replace="base/head::header"></header>

<div class="tpl-page-container tpl-page-header-fixed">
    <div th:replace="base/head::menu('module')"></div>
    <!--内容-->
    <div class="tpl-content-wrapper">
        <div class="tpl-content-page-title">
            用户数据管理
        </div>
        <ol class="am-breadcrumb">
            <li><a href="index" class="am-icon-home">首页</a></li>
            <li><a href="#">数据大屏</a></li>
            <li class="am-active">数据源管理</li>
        </ol>
        <div class="tpl-portlet-components">
            <div class="portlet-title">
                <div class="caption font-green bold">
                    <span class="am-icon-server"></span> 数据源管理
                </div>
            </div>

            <table class="am-table am-table-striped am-table-hover table-main" id="table">
                <thead>
                <tr>
                    <th>大屏名称</th>
                    <th>元素名称</th>
                    <th>数据源设置</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>


            <!-- 新增数据按钮 -->
            <div class="am-modal am-modal-no-btn am-modal-big" tabindex="-1" id="insertModule">
                <div class="am-modal-dialog">
                    <div class="am-modal-hd">数据源设置
                        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close onclick="emptyData()">&times;</a>
                    </div>
                    <div class="am-modal-bd">
                        <div class="am-tabs" style="height: calc(100% - 45px);" data-am-tabs="{noSwipe: 1}">
                            <ul class="am-tabs-nav am-nav am-nav-tabs">
                                <li class="am-active"><a href="#tab1">静态数据</a></li>
                                <li><a href="#tab2">数据API</a></li>
                                <li><a href="#tab3">数据库</a></li>
                            </ul>
                            <div class="am-tabs-bd" style="overflow-y: auto;height: calc(100% - 45px);">
                                <div class="am-tab-panel am-active" id="tab1">

                                    <div class="dataMenu-input am-form-inline">
                                        <div class="am-form-group">
                                            <input type="text" id="text_source_default" class="am-form-field" readonly value="静态数据">
                                        </div>
                                        <button class="am-btn am-btn-primary am-btn-sm dataMenu-post" data-tag="default">获取数据</button>
                                    </div>
                                    <div class="data_source" id="data_source_default"></div>

                                </div>
                                <div class="am-tab-panel" id="tab2">
                                    <div class="dataMenu-input am-form-inline">
                                        <div class="am-form-group">
                                            <input type="text" id="text_source_api" class="am-form-field" placeholder="请输入api访问url">
                                        </div>
                                        <button class="am-btn am-btn-primary am-btn-sm dataMenu-post" data-tag="api">获取数据</button>
                                    </div>
                                    <div class="data_source" id="data_source_api"></div>
                                </div>
                                <div class="am-tab-panel" id="tab3">
                                    <div class="dataMenu-input am-form-inline">
                                        <div class="am-form-group">
                                            <input type="text" id="text_source_database" class="am-form-field" placeholder="请输入数据库url|username|password|sql语句">
                                        </div>
                                        <button class="am-btn am-btn-primary am-btn-sm dataMenu-post" data-tag="database">获取数据</button>
                                    </div>
                                    <div class="data_source" id="data_source_database"></div>
                                </div>
                            </div>
                        </div>
                        <div style="float:right">
                            <button type="button" class="am-btn am-btn-default am-radius" data-am-modal-close onclick="emptyData()"><span
                                    class="am-icon-close"></span>关闭
                            </button>
                            <button type="button" class="am-btn am-btn-secondary am-radius"
                                    onclick="updateModuleData()"><span
                                    class="am-icon-save"></span> 保存
                            </button>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>

</div>

<div th:replace="base/foot"></div>
<script src="static/lib/datatables/amazeui.datatables.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/lib/jsoneditor/jsoneditor.min.js" type="text/javascript" charset="utf-8"></script>
<script src="static/js/module.js" type="text/javascript" charset="utf-8"></script>
</body>

</html>